using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace XiaoMan.Model.Models.Mapping
{
    public class Sys_UsersMap : EntityTypeConfiguration<Sys_Users>
    {
        public Sys_UsersMap()
        {
            // Primary Key
            this.HasKey(t => t.UserID);

            // Properties
            this.Property(t => t.UserName)
                .IsFixedLength()
                .HasMaxLength(11);

            this.Property(t => t.Password)
                .HasMaxLength(50);

            this.Property(t => t.Mobile)
                .IsFixedLength()
                .HasMaxLength(11);

            this.Property(t => t.NickName)
                .HasMaxLength(50);

            this.Property(t => t.UserPic)
                .HasMaxLength(150);

            this.Property(t => t.Email)
                .HasMaxLength(50);

            this.Property(t => t.QQ)
                .HasMaxLength(50);

            this.Property(t => t.WeChat)
                .HasMaxLength(50);

            this.Property(t => t.WeiBo)
                .HasMaxLength(50);

            // Table & Column Mappings
            this.ToTable("Sys_Users");
            this.Property(t => t.UserID).HasColumnName("UserID");
            this.Property(t => t.UserName).HasColumnName("UserName");
            this.Property(t => t.Password).HasColumnName("Password");
            this.Property(t => t.Mobile).HasColumnName("Mobile");
            this.Property(t => t.NickName).HasColumnName("NickName");
            this.Property(t => t.UserPic).HasColumnName("UserPic");
            this.Property(t => t.Email).HasColumnName("Email");
            this.Property(t => t.IsDelFlag).HasColumnName("IsDelFlag");
            this.Property(t => t.CreateTime).HasColumnName("CreateTime");
            this.Property(t => t.VerifyStatus).HasColumnName("VerifyStatus");
            this.Property(t => t.MainDiseaseID).HasColumnName("MainDiseaseID");
            this.Property(t => t.QQ).HasColumnName("QQ");
            this.Property(t => t.WeChat).HasColumnName("WeChat");
            this.Property(t => t.WeiBo).HasColumnName("WeiBo");
            this.Property(t => t.UserType).HasColumnName("UserType");
        }
    }
}
